﻿@using QqhrCitizen.Models.ViewModel
@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    Course course = ViewBag.Course as Course;
    ViewBag.Title = course.Title;
}

<h2 class="head-tietle">@course.Title - 课程详细  <a href="/Admin/CoursesEdit/@course.ID">修改</a></h2>

<table class="detail-table">
    <tr>
        <td class="row-title">一级分类</td>
        <td>
            @course.TypeDictionary.Belonger
        </td>
    </tr>
    <tr>
        <td class="row-title">二级分类</td>
        <td>
            @course.TypeDictionary.TypeValue
        </td>
    </tr>
    <tr>
        <td class="row-title">标题</td>
        <td>
            @course.Title
        </td>
    </tr>
    <tr>
        <td class="row-title">
            描述
        </td>
        <td>
            @course.Description
        </td>
    </tr>
    <tr>
        <td class="row-title">
            时间
        </td>
        <td>
            @course.Time
        </td>
    </tr>
    <tr>
        <td class="row-title">
            操作员
        </td>
        <td>
            @course.User.Username
        </td>
    </tr>
</table>

<div style="margin-top:20px;">
    <h2>课时   <a href="/Admin/AddLession/@course.ID">添加课时</a></h2>
    <table class="detail-table">
        <thead>
            <tr>
                <td>课时名称</td>
                <td>添加时间</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            @if (@course.Lessions.Count > 0)
            {
                foreach (var item in @course.Lessions)
                {
                    <tr>
                        <td>
                            @item.Title
                        </td>
                        <td>
                            @item.Time.ToString("yyyy-MM-dd HH:mm:ss")
                        </td>
                        <td>
                            <a href="/Admin/LessionShow/@item.ID">课时详情</a>
                            <a href="javascript:deleteDialog('/Admin/LessionDelete/' + @item.ID + '?sid=@ViewBag.SID',@item.ID);">删除</a>
                            <a href="/Admin/LessionEdit/@item.ID">修改</a>
                        </td>
                    </tr>
                }
            }
        </tbody>
    </table>
</div>
<div style="margin-top:20px;">
    <h2>课程测试 <a href="/Admin/AddCourseQuestion?Cid=@course.ID">增加课程测试</a></h2>
    <table class="detail-table">
        <thead>
            <tr>
                <td>编号</td>
                <td>备注</td>
                <td>时间</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in ViewBag.CourseQuestions)
            {
                <tr>
                    <td>@item.ID</td>
                    <td>@item.Remark</td>
                    <td>@item.Time</td>
                    <td>
                        <a href="/Admin/CourseQuestionShow/@item.ID">问题详情</a>
                        <a href="javascript:deleteDialog('/Admin/CourseQuestionDelete/' + @item.ID + '?sid=@ViewBag.SID',@item.ID);">删除</a>
                        @*<a href="/Admin/LessionEdit/@item.ID">修改</a>*@
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
<script